How to update the selected line in the Subform on click of an action button in the Mainform in NAV

Introduction:

  • The requirement was such that , the user will select a line in the subform.
  • The subform has fields like the Customer ID, Customer Name, and a field Recieved Crates.
  • On click of the action button in the Main form, a page opens which contains the details of the selected line in the subform  like Customer ID and Customer Name also a field Crate recieved(Integer Datatype).

  • User will enter Crate Recieved and click on OK. The number entered in the Crate received will modify in the Recieved crates field in the subform.

 

This blog explains the step wise procedure to achieve the above output.

Pre-Requisites:

Microsoft Dynamics NAV 2017

Steps:

  1. Open the Developement Environment of Microsoft Dynamics NAV and open the Main form(card Page) and create an action button Received Crate and write the below code.

Here, “Crate Lines” is the Page control (subform), Here a call is made to CallLinesfromCard  function with Parameter CratesLine.

CallLinesfromCard is a global function made in “Crate Lines”Subform.

2. In the function CallLinesfromCard  in the subform. Below is the code.

Here ReceiveCrate is a page. Its the page that open on click of the action button. A function is called CrateReceivedFromCust with parameter CrateLinesTable.

3. A global function is made CrateReceivedfromCust in the page ReceiveCrate. Here global fields variables are made CustomerID,CustomerName,NoOfcratesShipped.

Theses fields are autopopulated with values from the selected line.

A field Crates Received is also created where the user will enter data.

4. OnQueryClosePage of Receive Page, below code is written to modify the Record of the Subform

5. Set the property RefreshOnactive to yes on the Subform and Mainform

 

 

9 thoughts on “How to update the selected line in the Subform on click of an action button in the Mainform in NAV

  1. Hi there! Someone in my Myspace group shared this site with us so I came to look it over. I’m definitely loving the information. I’m bookmarking and will be tweeting this to my followers! Excellent blog and great style and design.|

    Liked by 1 person

  2. When someone writes an paragraph he/she retains the plan of a user in his/her mind that how a user can be aware of it. Therefore that’s why this piece of writing is outstdanding. Thanks!|

    Liked by 1 person

  3. Appreciating the time and energy you put into your blog and detailed information you provide. It’s good to come across a blog every once in a while that isn’t the same outdated rehashed material. Great read! I’ve saved your site and I’m adding your RSS feeds to my Google account.|

    Liked by 1 person

  4. My partner and I stumbled over here by a different page and thought I might as well check things out. I like what I see so i am just following you. Look forward to going over your web page repeatedly.|

    Like

  5. I feel that is one of the such a lot vital info for me. And i’m glad reading your article. But want to observation on some normal things, The website style is wonderful, the articles is really nice : D. Excellent task, cheers|

    Like

  6. Pretty element of content. I just stumbled upon your blog and in accession capital to claim that I acquire actually loved account your weblog posts. Anyway I will be subscribing to your feeds and even I fulfillment you access constantly fast.|

    Like

  7. Good day! This is my first comment here so I just wanted to give a quick shout out and tell you I truly enjoy reading your blog posts. Can you suggest any other blogs/websites/forums that cover the same topics? Many thanks!|

    Like

Leave a comment